/**
 * Created by Administrator on 20213/21.
 * district Model 章节信息
 */
let DbInit = require('./DbInit');
let sequelize = DbInit.sequelize;
let Sequelize=DbInit.seqobj;
let payment = sequelize.define('payment', {

    id: {
        type: Sequelize.INTEGER,
        autoIncrement: true,
        primaryKey: true
    },
    bookid:{//书籍id
        type: Sequelize.STRING(30),
        primaryKey:true,
        allowNull:false
    },
    chapterid:{//章节id
        type: Sequelize.STRING(100),
        allowNull:true
    },
    type: {//支付类型
        type: Sequelize.TEXT,
        allowNull:true
    },
    price:{//支付金额
        type: Sequelize.STRING(50),
        allowNull:true
    },
    pv:{//
        type: Sequelize.STRING(10),
        allowNull:true
    },
    userip: {//用户ip信息
        type: Sequelize.STRING(30),
        allowNull: true
      },
    status:{
        type: Sequelize.CHAR(1),
        allowNull:true
    }

}, {
    createdAt: 'creattime',
    updatedAt:'updatetime',
    charset: 'utf8',
    collate: 'utf8_general_ci',
    freezeTableName: true // Model 对应的表名将与model名相同
});


payment.sync({ alter: true })
module.exports = payment;